from flask import Blueprint, request, render_template, session, redirect

user = Blueprint("user", __name__)

tanck = ''
userlist = []
dictt = {}
@user.route("/reg", methods=["GET", "POST"])
def reg():
    global userlist
    if request.method == "GET":
        return render_template("reg.html")
    else:
        username = request.form.get("username")
        dictt["username"] = username

        userlist.append(dictt)
        return "注册成功"

list
@user.route("/login", methods=["GET", "POST"])
def login():
    global tanck
    print(userlist)
    if request.method == "GET":
        return render_template("login.html")
    else:
        username = request.form.get("username")
        if dictt["username"] == username:
            tanck = "123456"
            session["username"] = username
            return redirect("/page")
        else:
            return redirect("/reg")
from flask_sqlalchemy import Pagination